package com.ojoin.trade.common.web.domain;

import java.util.Map;
import java.util.Set;

public class LdapConfigResponse {

	boolean connected;
	boolean systemAuthenticated;
	boolean loginAuthenticated;
	Map<String, String> entry;
	Set<String> groups;
	String exception;

	public LdapConfigResponse(boolean connected, boolean systemAuthenticated,
			boolean loginAuthenticated, Map<String, String> entry,
			Set<String> groups, String exception) {
		
		this.connected=connected;
		this.systemAuthenticated=systemAuthenticated;
		this.loginAuthenticated=loginAuthenticated;
		this.entry=entry;
		this.groups=groups;
		this.exception=exception;

	}

	public static LdapConfigResponse create(boolean connected,
			boolean systemAuthenticated, boolean loginAuthenticated,
			Map<String, String> entry, Set<String> groups,String exception) {
		return new LdapConfigResponse(connected, systemAuthenticated,
				loginAuthenticated, entry, groups, exception);
	}
	
	public static LdapConfigResponse create(boolean connected,
			boolean systemAuthenticated, boolean loginAuthenticated,
			Map<String, String> entry, Set<String> groups) {
		return new LdapConfigResponse(connected, systemAuthenticated,
				loginAuthenticated, entry, groups, null);
	}
}
